Skip to content

Strip endpoint hostname trailing slash#229

Merged
steffyP merged 2 commits intolocalstack:masterfrom
kristallizer:krishna/fix-endpoint-hostname-output
Jan 23, 2024
Merged

Strip endpoint hostname trailing slash#229
steffyP merged 2 commits intolocalstack:masterfrom
kristallizer:krishna/fix-endpoint-hostname-output

Conversation

@kristallizer
Copy link
Contributor

@kristallizer kristallizer commented Aug 3, 2023

Not stripping the trailing slash leads to malformed URLs in the output:

Before: https://7d7c2bf6.execute-api.localhost.localstack.cloud:4566//local/task
After: https://7d7c2bf6.execute-api.localhost.localstack.cloud:4566/local/task

The right choice here is dependent on how you define the path in serverless.yml. Seeing how the official docs for API Gateway v2 add a / before the path, I propose that the trailing slash should be stripped here.

Not stripping the trailing slash leads to malformed URLs in the output, like so: https://7d7c2bf6.execute-api.localhost.localstack.cloud:4566//local/task
@thrau thrau requested a review from joe4dev August 3, 2023 20:21
The earlier fix broke old Serverles endpoints
@steffyP steffyP self-requested a review January 23, 2024 16:45
Copy link
Member

@steffyP steffyP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kristallizer,
sorry for the long delay. I have tested your changes, and it's working 👍
Nice job 🚀

@steffyP steffyP merged commit 2636301 into localstack:master Jan 23, 2024
@kristallizer kristallizer deleted the krishna/fix-endpoint-hostname-output branch January 23, 2024 17:02
@steffyP
Copy link
Member

steffyP commented Jan 29, 2024

Hi @kristallizer,
your fix was released with serverless-localstack version 1.2.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants